<template>
  <view>
    <view class="publishContain defaultMain">
      <u-cell-group>
        <u-cell-item title="标题" :arrow="false" :border="false" required :value="title"></u-cell-item>
        <u-cell-item title="事件类别" :arrow="false" :border="false" required :value="category_name"></u-cell-item>
      </u-cell-group>
      <mypicture ref="mypicture" type="detail" :album-list="takePicList">
        <view>拍照</view>
      </mypicture>
      <myvideo ref="myvideo" type="detail" :old-video-list="videoList">
        <view>录像</view>
      </myvideo>
      <!-- 描述 -->
      <view class="desStyle">
        <view class="desLabel">
          <view style="margin-bottom: 26rpx;">描述</view>
        </view>
        <view class="desContent">
          {{ description }}
        </view>
      </view>
    </view>
  </view>
</template>
<script>
import mypicture from "../picvideo/picture.vue";
import myvideo from "../picvideo/video.vue";

export default {
  name: "SuishouSubmit",
  props: {
    title: {
      type: String,
      default: ''
    },
    category_name: {
      type: String,
      default: ''
    },
    description: {
      type: String,
      default: ''
    },
    takePicList: {
      type: Array,
      default: []
    },
    videoList: {
      type: Array,
      default: []
    }
  },
  components: {
    mypicture,
    myvideo
  },
  mounted() {
    // console.log('suiDetail mounted------', this.takePicList)

    // const content_id = this.$Router.extract(this.options).content_id
    /*contentInfo({content_id: this.content_id}).then(res => {
      console.log('suiDetail mounted---',typeof res.imgs, res)
      this.content_id = res.content_id
      this.title = res.name
      this.category_id = res.category_id
      this.category_name = res.category_name
      this.description = res.description
      this.takePicList = res.imgs
      this.$refs.mypicture.$data.takePicList = res.imgs
      this.videoList = res.videos
      this.$refs.myvideo.$data.videoList = res.videos
      this.photographFree.latitude = res.latitude
      this.photographFree.longitude = res.longitude
    })*/
  },
  /* onLoad (options) {
    if (options.encodedData !== 'undefined') {
      const { id, title, pic, status, description } = this.$Router.extract(options).record
      this.id = id
      this.title = title
      this.pic = pic
      this.status = status
      this.description = description
    }
  }, */
  data() {
    return {
      // record: {},
      // title: '',
      // takePicList: [],
      // videoList: [],
      // 地图
      /*mapVisible: false,
      photographFree: {
        latitude: null,
        longitude: null,
      },*/
      // 描述
      type: "textarea",
      border: true,
      width: 750,
      height: 150,
      autoHeight: true,
    }
  },
  methods: {
    init () {
      // console.log('init----', this.takePicList, this.videoList)
      this.$refs.mypicture.$data.takePicList = this.takePicList
      this.$refs.myvideo.$data.videoList = this.videoList
    }
  },
};
</script>
<style lang="scss" scoped>
.publishContain {
  padding: 0 0 100rpx;
  background-color: #fff;
}
.desStyle {
  padding: 20rpx;
  background-color: #fff;
}
.desLabel {
  display: flex;
  justify-content: space-between;
}
.desContent {
  width: 100%;
  min-height: 300rpx;
  padding: 20rpx;
  border: 1rpx solid #eee;
  border-radius: 10rpx;
}
</style>